//
//  NaviGationBarView.m
//  WanCiWang
//
//  Created by rimi on 2016/11/28.
//  Copyright © 2016年 dongfumei. All rights reserved.
//

#import "NaviGationBarView.h"

@implementation NaviGationBarView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self addSubview:self.backButton];
        [self addSubview:self.titleLabel];
    }
    return self;
}

-(UIButton *)backButton{
    if (!_backButton) {
        _backButton = [[UIButton alloc]initWithFrame:CGRectMake(20, 25, 20, 20)];
        [_backButton setImage:[UIImage imageNamed:@"黑色返回"] forState:UIControlStateNormal];
    }
    return _backButton;
}

-(UILabel *)titleLabel{
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(40, 20, [UIScreen mainScreen].bounds.size.width - 80, 40)];
        _titleLabel.text = @"默认标题";
        _titleLabel.textColor = [UIColor whiteColor];
        _titleLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _titleLabel;
}

@end
